const app = getApp()
import { requestApi } from '../../../api'

Page({
    data: {
        winHeight: 0,
        channel: '',
    },

    onLoad: function (options) {
      let channel = options.channel || 'wx_xcx'

      let systemInfo = {}

      try {
        systemInfo = wx.getSystemInfoSync()
      } catch (e) {
        // Do something when catch error
      }

      this.setData({
        winHeight: systemInfo.windowHeight,
      })

      this.data.channel = channel
    },

    searchGoods: function (e) {
        let keywords = e.detail.value

        wx.navigateTo ({
          url: '/pages/categoryHall/categoryHall?keywords=' + keywords + '&channel=' + this.data.channel,
        })
    },

    navigateBack: function (e) {
        wx.navigateBack({
            delta: 1
        })
    },
})